package com.example.day23;

import java.util.function.Function;

/**
 * @author Lenovo
 */
public class FunctionDemo {
    public static void main(String[] args) {
        convrt("100", s -> Integer.parseInt(s));
        convert(100, i -> String.valueOf(i + 566));
        convert("100", s -> Integer.parseInt(s), i -> String.valueOf(i + 566));
    }


    private static void convert(String s, Function<String, Integer> fun) {

        Integer i = fun.apply(s);
        int i = fun.apply(s);
        System.out.println(i);
    }

    private static void convert(int i, Function<Integer, String> fun) {

        String s = fun.apply(i);
        System.out.println(s);
    }

    private static void convrt(String s, Function<String, Integer> fun) {
        Integer i = fun.apply(s);
        System.out.println(i);
    }
}

